<template>
  <div class="login">
     <div :model="list">
          <p>
          账号：<input type="text" v-model="list.username">
      </p>
    <p>
          
          密码：<input type="text" v-model="list.password">
      </p>
      <button @click="gologin">登录</button>
     </div>
  </div>
</template>

<script>
import axios from 'axios'
    import {getLogin} from '../utils/api/index'

export default {
  name: 'login',
  data() {
      return {
          list:{
              username:'',
              password:''
          }
      }
  },
  methods:{
      gologin(){
            axios.post('http://ceshi5.dishait.cn/admin/login',{
              username:this.list.username,
              password:this.list.password
          }).then(res=>{
              localStorage.setItem('token',res.data.data.token)
          })
            this.$router.push('/')
      },
  }
}
</script>
